﻿<UserControl x:Class="NexTrackDesktop.Controls.FacebookLogin"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="800">

    <Grid>
        <!--If the login dialog is loading, it doesn't show up
             if the user is not logged in, it appears. -->
        <Grid.Style>
            <Style TargetType="Grid">
                <Setter Property="Visibility" Value="Hidden" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=LoggedIn}" Value="True">
                        <Setter Property="Visibility" Value="Hidden" />
                    </DataTrigger>
                    
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding Path=LoggedIn}" Value="False" />
                            <Condition Binding="{Binding Path=Loading}" Value="False" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible" />
                    </MultiDataTrigger>
                    
                </Style.Triggers>
            </Style>
        </Grid.Style>

        <Border HorizontalAlignment="Center" VerticalAlignment="Center" Width="600" Height="450"
              Background="White" BorderBrush="Black" BorderThickness="1">
            <Grid>
                <TextBlock Text="Please log into facebook in order to begin your party:"
                           VerticalAlignment="Top" Margin="5"/>

                <!-- <WindowsFormsHost x:Name="formsHost" Margin="5,25,5,5"/> -->
                <WebBrowser x:Name="loginBrowser" Margin="5,25,5,5"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>
